﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UWP.Douban.Models;
using UWP.Douban.SampleData;
using UWP.Douban.Utils;
using Windows.Storage;
using Windows.UI.Xaml.Navigation;

namespace UWP.Douban.Mvvm
{
    public class AnonymousTopicVm:BaseVm
    {
        public AnonymousTopicVm()
        {
            this.ExploreTopics = new ObservableCollection<Models.Topic>();
            this.CultureTopics = new ObservableCollection<Models.Topic>();
            this.TravelTopics  = new ObservableCollection<Models.Topic>();
            this.EntTopics     = new ObservableCollection<Models.Topic>();
            this.FashionTopics = new ObservableCollection<Models.Topic>();
            this.LifeTopics    = new ObservableCollection<Models.Topic>();
            this.TechTopics    = new ObservableCollection<Models.Topic>();
        }

        private async void InitVmSample()
        {
            var topics = await SampleDataUtil.GetTopics();

            foreach (var item in topics)
            {
                ExploreTopics.Add(item);
            }
        }

        public override void OnNavigatedTo(NavigationEventArgs e)
        {
            InitVmSample();
        }

        public ObservableCollection<Topic> ExploreTopics { get; set; }
        public ObservableCollection<Topic> CultureTopics { get; set; }
        public ObservableCollection<Topic> TravelTopics { get; set; }
        public ObservableCollection<Topic> EntTopics { get; set; }
        public ObservableCollection<Topic> FashionTopics { get; set; }
        public ObservableCollection<Topic> LifeTopics { get; set; }
        public ObservableCollection<Topic> TechTopics { get; set; }

    }
}
